<?php namespace Summer\Hjd\Widgets;

use Str;
use Input;
use Flash;
use Validator;
use ValidationException;
use Backend\Classes\WidgetBase;
use Summer\Hjd\Models\CurrencyModel;
use Summer\Hjd\Models\BonusRuleModel;


/**
 * 奖金规则
 */
class RuleBonus extends WidgetBase
{
    public function __construct($controller, $alias)
    {
        $this->alias = $alias;
        parent::__construct($controller, []);
        $this->bindToController();
    }

    /**
     * Renders the widget.
     * @return string
     */
    public function render()
    {
        //币种
        $currencies=CurrencyModel::where('status',1)->get();
        $this->vars['currencies'] = $currencies;
        //规则
        $this->vars['rules'] = $this->getData();
        return $this->makePartial('body');
    }
    public function getData(){
        $rules=BonusRuleModel::get();
        return $rules;
    }



}
